﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="frm" uri="http://www.springframework.org/tags/form" %>
<c:set var="contextPath" value="<%=getServletContext().getContextPath()%>" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>First Data Payment</title>
    <link rel="stylesheet" href="${contextPath }/resources/css/mce.css"></link>
    <link rel="stylesheet" href="${contextPath }/resources/css/size.css" ></link>
    <link rel="stylesheet" href="${contextPath }/resources/css/jquery-ui.css" ></link>
    <link href='http://fonts.googleapis.com/css?family=Lato:400,300,700,400italic' rel='stylesheet' type='text/css' ></link>
    <script type="text/javascript" src="${contextPath }/resources/js/jquery/jquery-1.10.1.js"></script>
    <script type="text/javascript" src="${contextPath }/resources/js/jquery-ui/jquery-ui.js"></script>
    <script type="text/javascript" src="${contextPath }/resources/js/validation/validation.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#processing").dialog({
		        autoOpen: false,
		        open: function () {		            
		            $("#ovl").attr("class", "ovl");
		            $("#ovl").fadeIn();
		            $("body").css({ overflow: 'hidden' });
		            $(".ui-dialog-titlebar-close").hide();		      
		            $(".ui-dialog-titlebar").hide();      
		        },
		        width:600,
		        height: 130,
		        close: function () {
		            $("#ovl").removeAttr('style').removeAttr('class');
		            $("body").css({ overflow: 'scroll' });
		        }
		    });
		    
			
		    //Open dialog
		    $("#processing").dialog('open');
		});
	</script>
</head>
<body onload="payToFirstData();">
<div id="ovl" class="ovl"></div>
	<frm:form id="paymentForm"
		action="https://connect.merchanttest.firstdataglobalgateway.com/IPGConnect/gateway/processing"
		method="post">
		<table>
			<tr>
				<td><input type="hidden"
					name="timezone" value="${firstDataModel.timezone }"></input>
				</td>

			</tr>
			<tr>
				<td><input type="hidden"
					name="authenticateTransaction"
					value="${firstDataModel.authenticateTransaction}"></input>
				</td>
			</tr>
			<tr>
				<td><input
					size="50" type="hidden" name="paymentMethod"
					value="${firstDataModel.paymentMethod}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50"
					type="hidden" name="txntype" value="${firstDataModel.txntype}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50"
					type="hidden" name="txndatetime"
					value="${firstDataModel.txndatetime}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50" type="hidden"
					name="hash" value="${firstDataModel.hash}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50" type="hidden"
					name="mode" value="${firstDataModel.mode}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50"
					type="hidden" name="storename" value="${firstDataModel.storename}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50"
					type="hidden" name="chargetotal"
					value="${firstDataModel.chargetotal}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50"
					type="hidden" name="subtotal" value="${firstDataModel.subtotal}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50"
					type="hidden" name="trxOrigin" value="${firstDataModel.trxOrigin}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50" type="hidden"
					name="oid" value="${firstDataModel.iod}"></input>
				</td>
			</tr>
			<tr>
				<td><input size="50"
					type="hidden" name="tdate" value="${firstDataModel.tdate}"></input>
				</td>
			</tr>
			<tr>
				<td><input
					type="hidden" name="responseSuccessURL"
					value="${firstDataModel.responseSuccessURL}"></input>
				</td>
			</tr>
		</table>
	</frm:form>
	<script type="text/javascript">
		function payToFirstData(){
			$("#paymentForm").submit();
			}
	</script>
</body>
</html>
<!--DIALOG-->
    <div id="processing" title="Processing">
        <h1 style="color:red;">Connecting to First Data Payment Gateway.....</h1>
    </div>
    <!--DIALOG-->